package com.spzx.product.api;

import com.spzx.common.core.constant.SecurityConstants;
import com.spzx.common.core.constant.ServiceNameConstants;
import com.spzx.common.core.domain.R;
import com.spzx.product.api.factory.RemoteProductFallbackFactory;
import com.spzx.product.api.model.ProductSku;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestHeader;


@FeignClient(
        value = ServiceNameConstants.PRODUCT_SERVICE,
        path = "/productSku",//业务接口基础URL地址
        fallbackFactory = RemoteProductFallbackFactory.class //确保呗IOC容器扫描注册对象
)
public interface RemoteProductService {
    @Operation(summary = "获取商品SKU详情")
    @GetMapping("/getProductSku/{skuId}")
    public R<ProductSku> gettProductsku(@PathVariable("skuId") Long skuId, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

}
